/**
 * TestCalculator.java 1.0 2007-6-21 下午10:07:01,创建 by yangfan
 */


package org.in4j.compiler.sandbox.calcuator;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 *
 * @author yangfan
 * @version 1.0 2007-6-21 下午10:07:01,创建
 */
public class TestCalculator
{
	@SuppressWarnings("unused")
	private static final Log log = LogFactory.getLog(TestCalculator.class);

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		String expression = "1 + 2 - 3 + 7 + 4 - 2";
		Context ctx = new Context(expression);
		TermNode termNode = new TermNode();
		termNode.parse(ctx);
		termNode.execute();
		System.out.println("result==>" + termNode.getValue());
	}
}
